<template>
    <div>
      <!-- 面包屑导航条 -->
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/home' }">系统中心</el-breadcrumb-item>
        <el-breadcrumb-item >所有管理的学生</el-breadcrumb-item>
      </el-breadcrumb>
        <!--卡片视图 -->
        <el-card class="box-card">


            <template>
                <el-table
                        :data="Sellerlist"
                        height="250"
                        border
                        style="width: 100%">
                    <el-table-column
                            prop="id"
                            label="学生ID"
                            width="130">
                    </el-table-column>
                  <el-table-column
                    prop="userName"
                    label="学生登录名"
                    width="130">
                  </el-table-column>
                  <el-table-column
                    prop="sellerId"
                    label="所属销售"
                    width="130">
                  </el-table-column>
                    <el-table-column
                            prop="mobile"
                            label="学生手机号"
                            width="130">
                    </el-table-column>
                    <el-table-column
                            prop="nickName"
                            label="学生姓名"
                            width="130">
                    </el-table-column>
                  <el-table-column
                    prop="studentFee"
                    label="学生费用余额"
                    width="130">
                  </el-table-column>
                    <el-table-column
                            label="创建时间"
                            width="130">
                        <template slot-scope="scope">
                            {{scope.row.createTime | datefmt('YYYY/MM/DD')}}
                        </template>
                    </el-table-column>
                  <el-table-column
                    prop="status"
                    label="学生标志"
                    width="90">
                    <template slot-scope="scope">
                      {{scope.row.status | statusFmt}}
                    </template>
                  </el-table-column>
                    <el-table-column label="操作">
                      <template slot-scope="scope">

                        </template>

                    </el-table-column>
                </el-table>

                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="page.currentPage"
                        :page-sizes="[1, 3, 5, 7]"
                        :page-size="page.pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="page.total">
                </el-pagination>
            </template>

        </el-card>
    </div>
</template>
<script>
    import axios from 'axios'

    export default {
        name: "SellerListAllStudent",
      data(){
        return{
          Sellerlist:[],
          userFormVisible:false,
          userForm:{

          },

          page:{
            total:0,
            currentPage:0,
            pageSize:2
          },
        }
      },
      methods: {
        seatlist: function (id) {
          this.$http.post("/getStudentByPage?userId="+id+"&currentPage=" + this.page.currentPage + "&pageSize=" + this.page.pageSize).then((res) => {
            this.Sellerlist = res.data.result.students.records;
            this.page.total = res.data.result.total;
          })
        },
        handleSizeChange:function (val) {
          this.page.pageSize=val
          this.seatlist();
        },
        handleCurrentChange:function (val) {
          this.page.currentPage=val
          this.seatlist();
        },
        cleanUser:function () {
          this.userForm={}
        }
      },
      filters:{
        statusFmt:function (val) {
          if(val==0){
            return "正常"
          }
          if(val==1){
            return "锁定"
          }
        }
      },
      mounted(){
       var seller= JSON.parse(sessionStorage.getItem("seller"));
        this.seatlist(seller.id);
      }
    }
</script>

<style scoped>

</style>
